#ifndef CONFIGURATION
#define CONFIGURATION
#include "../FileProcessor/FileProcessor.h"
#include <string>
#include <map>
using namespace std;
class Configuration{
	public:
		static void initialize();		
		static void addConfig(string,string);
		static string getConfig(string);
		static map<string, string> myConfig;
	private:					
		static void getConfigFromFile();
 };

map<string, string> Configuration::myConfig;
void Configuration::initialize(){		
	//ConfigData *pnewConfig=0;
	getConfigFromFile();
}
void Configuration::getConfigFromFile(){
	vector<string> configline;
	vector<string> config;
	configline=FileProcessor::readFileContentByLine("app/config/config.txt");

	for(int i=0;i<configline.size();i++){
		config=StringProcessor::explode("::",configline.at(i));
		//cout<<config.size()<<endl;
		if(config.size()>=2){

			addConfig(config.at(0),config.at(1));
		}
	}	
}
string Configuration::getConfig(string name){
	if(myConfig.count(name)>0)return myConfig[name];
	return "";
}
void Configuration::addConfig(string name, string value){	
	myConfig.insert(pair<string, string>(name,value));
	//first element
}
#endif
